export default {
  name: '散点层',
  code: 'custom_map_group_marker',
  version: '1.0.0',
  config: [
    {
      name: '默认配置',
      code: 'default',
      children: [
        {
          name: '显示类型',
          code: 'content',
          type: 'ChangeConfig',
          value: {
            type: 'spot',
            // 散点value
            shape: 'location',
            colors: [
              {
                id: 1000,
                start: 1,
                end: 1,
                color: '#3399CC',
              },
            ],
            // 图标value
            imageUrl: '',
          },
          enumValue: [
            {
              key: '散点',
              value: 'spot',
              change: [
                {
                  name: '散点样式',
                  code: 'shape',
                  type: 'FontSelect',
                  enumValue: [
                    { name: '类型1', img: 'location' },
                    { name: '类型2', img: 'markercircle-copy' },
                    { name: '类型3', img: 'triangle' },
                    { name: '类型4', img: 'square' },
                    { name: '类型5', img: 'diamond' },
                    { name: '类型6', img: 'markeryuandian' },
                  ],
                },
                {
                  name: '散点颜色',
                  code: 'colors',
                  type: 'RangeColors',
                  min: 1,
                  template: {
                    id: Math.floor(Math.random() * 1000),
                    start: 1,
                    end: 1,
                    color: '#3399CC',
                  },
                },
              ],
            },
            {
              key: '图标',
              value: 'image',
              change: [
                {
                  name: '图标图片',
                  code: 'imageUrl',
                  type: 'ImgUpdate',
                },
              ],
            },
          ],
        },
        {
          name: '标注中心设置',
          code: 'position',
          value: 'center',
          type: 'Radio',
          enumValue: [
            {
              key: '图标中心点',
              value: 'center',
            },
            {
              key: '图标底部中心',
              value: 'bottom',
            },
          ],
        },
        {
          name: '图标尺寸最小值',
          code: 'minSize',
          value: 15,
          min: 1,
          max: 999,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '图标尺寸最大值',
          code: 'maxSize',
          value: 30,
          min: 1,
          max: 999,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '自适应散点位置',
          code: 'toFit',
          type: 'Radio',
          value: false,
          enumValue: [
            { key: '是', value: true },
            { key: '否', value: false },
          ],
        },
        {
          name: '适应边距',
          code: 'boundaryMargin',
          type: 'InputNumber',
          value: 100,
        },
      ],
    },
    {
      name: '聚合设置',
      code: 'cluster',
      children: [
        {
          name: '是否使用聚合',
          code: 'useCluster',
          type: 'Radio',
          value: false,
          enumValue: [
            { key: '是', value: true },
            { key: '否', value: false },
          ],
        },
        {
          name: '聚合范围',
          code: 'clusterRadius',
          type: 'InputNumber',
          value: 320,
        },
        {
          name: '图标基础半径',
          code: 'clusterSize',
          type: 'InputNumber',
          value: 50,
        },
        {
          name: '鼠标划过显示轮廓',
          code: 'showCoverage',
          type: 'Radio',
          value: true,
          enumValue: [
            { key: '是', value: true },
            { key: '否', value: false },
          ],
        },
        {
          name: '数字',
          code: 'font',
          type: 'FontGroup',
          value: {
            fontSize: 14,
            fontFamily: 'siyuan',
            color: '#fff',
            fontWeight: 'bold',
          },
        },
        {
          code: 'backgroundImage',
          name: '背景图片',
          type: 'ImgUpdate',
        },
      ],
    },
    {
      name: '提示框设置',
      code: 'tooltip',
      children: [
        {
          code: 'show',
          value: 'always',
          type: 'Radio',
          enumValue: [
            {
              key: '无提示',
              value: 'hide',
            },
            {
              key: '提示一直存在',
              value: 'always',
            },
            {
              key: '鼠标划过提示',
              value: 'hover',
            },
            {
              key: '点击提示',
              value: 'click',
            },
          ],
        },
        {
          name: '文本设置',
          code: 'font',
          type: 'FontGroup',
          value: {
            fontSize: 14,
            fontFamily: 'siyuan',
            color: '#000',
            fontWeight: 'bold',
          },
        },
        {
          name: '边框粗细',
          code: 'borderWidth',
          min: 0,
          value: 3,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '边框颜色',
          code: 'borderColor',
          value: '#3399CC',
          type: 'ColorSelector',
        },
        {
          name: '背景来源',
          code: 'background',
          type: 'ChangeConfig',
          value: {
            type: 'color',
            backgroundColor: '#369',
            imageUrl: '',
          },
          enumValue: [
            {
              key: '颜色背景',
              value: 'color',
              change: [
                {
                  name: '背景颜色设置',
                  code: 'backgroundColor',
                  type: 'ColorSelector',
                },
              ],
            },
            {
              key: '图片背景',
              value: 'image',
              change: [
                {
                  name: '背景图片地址',
                  code: 'imageUrl',
                  type: 'ImgUpdate',
                },
              ],
            },
          ],
        },
        {
          name: '尺寸设置',
          code: 'size',
          children: [
            {
              name: '固定宽高',
              code: 'constant',
              type: 'Radio',
              value: false,
              enumValue: [
                { key: '是', value: true },
                { key: '否', value: false },
              ],
            },
            {
              name: '宽',
              code: 'width',
              value: 400,
              type: 'InputNumber',
            },
            {
              name: '高',
              code: 'height',
              value: 400,
              type: 'InputNumber',
            },
          ],
        },
        {
          name: '位置设置',
          code: 'position',
          children: [
            {
              name: '左右对齐方式',
              code: 'align',
              type: 'Radio',
              value: 'center',
              enumValue: [
                { key: '左', value: 'left' },
                { key: '中', value: 'center' },
                { key: '右', value: 'right' },
              ],
            },
            {
              name: '距顶部距离',
              code: 'top',
              value: 400,
              type: 'InputNumber',
            },
          ],
        },
      ],
    },
    {
      name: '弹窗设置',
      code: 'popup',
      children: [
        {
          name: '弹窗宽度',
          code: 'width',
          value: 400,
          min: 10,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '弹窗高度',
          code: 'height',
          value: 400,
          min: 10,
          type: 'InputNumber',
          unit: 'px',
        },
        // {
        //   name: '弹框距上边距离',
        //   code: 'top',
        //   min: 0,
        //   value: 100,
        //   type: 'InputNumber',
        //   unit: 'px'
        // },
        // {
        //   name: '弹框距右边距离',
        //   code: 'right',
        //   value: 100,
        //   min: 0,
        //   type: 'InputNumber',
        //   unit: 'px'
        // },
        {
          name: '边框线条',
          code: 'borderWidth',
          value: 2,
          min: 0,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '边框颜色',
          code: 'borderColor',
          type: 'ColorSelector',
          value: '#369',
        },
        {
          name: '背景颜色',
          code: 'backgroundColor',
          type: 'ColorSelector',
          value: '#234',
        },
      ],
    },
    {
      name: '动作设置',
      code: 'action',
      children: [
        {
          code: 'detail',
          type: 'ChangeConfig',
          value: {
            type: 'none',
            target: 'forward',
          },
          enumValue: [
            {
              key: '无',
              value: 'none',
            },
            {
              key: '页面跳转',
              value: 'link',
              change: [
                {
                  code: 'target',
                  type: 'Radio',
                  enumValue: [
                    {
                      key: '本窗口打开',
                      value: 'forward',
                    },
                    {
                      key: '新窗口打开',
                      value: 'newTab',
                    },
                  ],
                },
              ],
            },
            {
              key: '弹窗',
              value: 'popup',
            },
          ],
        },
      ],
    },
  ],
  data: {
    field: [
      { name: 'lng', mapper: 'lng' },
      { name: 'lat', mapper: 'lat' },
      { name: 'id', mapper: 'id' },
      { name: 'value', mapper: 'count', optional: true },
      { name: 'tooltip', mapper: 'text', optional: true },
      { name: 'link', mapper: 'url', optional: true },
      { name: 'iframe', mapper: '', optional: true },
    ],
    type: 1,
    value: JSON.stringify([
      {
        lat: 31.395141,
        lng: 100.180187,
        id: '32',
        count: 187,
        text: '文字信息对应数据info;可用分号换行',
        url: 'http://monet.urban-computing.cn/monet-doc/',
      },
      {
        lat: 31.396141,
        lng: 100.170187,
        id: '33',
        count: 187,
        text: '文字信息对应数据info;可用分号换行',
        url: 'http://monet.urban-computing.cn/monet-doc/',
      },
      {
        lat: 37.314268,
        lng: 104.033458,
        id: '34',
        count: 58,
        text: '散点支持弹窗交互',
        url: 'http://monet.urban-computing.cn/monet-doc/',
      },
      {
        lat: 35.517994,
        lng: 112.050051,
        count: 31,
        id: '35',
        text: '弹框',
        url: 'http://monet.urban-computing.cn/monet-doc/',
      },
    ]),
  },
  events: {
    click: {
      description: '标签点击响应事件',
      fields: {
        lng: {
          mapper: '',
          description: '经度',
          value: 116,
        },
        lat: {
          mapper: '',
          description: '纬度',
          value: 39,
        },
        id: {
          mapper: '',
          description: 'id',
          value: '',
        },
      },
      action: {
        active: false,
      },
    },
  },
};
